package com.allqj.sfx.ddd.member.application.dto;

import com.allqj.sfx.ddd.member.domain.enums.BusinessExceptionEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author sjw
 * @className LoginDTO
 * @date 2022/7/20 9:30
 * @description: 登录dto
 * DTO 位于application层
 */
@ApiModel("用户登录信息实体类")
public class AdminUserLoginDTO {
    // 账号
    @ApiModelProperty(value = "用户名", example = "18888888888")
    private String account;
    // 密码
    @ApiModelProperty(value = "用户密码", example = "123456")
    private String password;

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 参数合法性校验
     */
    public void validate() {
        if(account==null || password==null)
            BusinessExceptionEnum.ARGS_ERROR.throwException();
    }

}
